package com.itheima.service.impl;

import com.itheima.mapper.FluxMapper;
import com.itheima.pojo.Flux;
import com.itheima.service.FluxService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;
import java.util.List;

@Service
public class FluxServiceImpl implements FluxService {
    @Autowired
    private FluxMapper fluxMapper;
    @Override
    public void add(Flux flux) {
        fluxMapper.add(flux);
    }

    @Override
    public List<Flux> findFluxByTimeRange(LocalDateTime startTime, LocalDateTime endTime) {
        List<Flux> fluxList= fluxMapper.findFluxByTimeRange(startTime,endTime);
        return fluxList;
    }

    @Override
    public Flux findFluxByTimestamp(LocalDateTime TimeStamp) {
        Flux flux = fluxMapper.findFluxByTimestamp(TimeStamp);
        return flux;
    }

    @Override
    public List<Flux> findFluxInLatestDayData(){
        List<Flux> fluxList = fluxMapper.findFluxInLatestDayData();
        return fluxList;
    }

    @Override
    public Integer findFluxAllNumber(){
        Integer fluxNumber = fluxMapper.findFluxAllNumber();
        return fluxNumber;
    }
}
